{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "pythonjvsc74a57bd0396a50fe81f1c7bb7b506794689ca695cc0218bb7308476737597c730531a741",
   "display_name": "Python 3.8.8  ('.venv': pipenv)"
  },
  "metadata": {
   "interpreter": {
    "hash": "396a50fe81f1c7bb7b506794689ca695cc0218bb7308476737597c730531a741"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "output_type": "error",
     "ename": "ValueError",
     "evalue": "Invalid isoformat string: '2020:08:01:00:00'",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-4-fc1455d32b67>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mdatetime\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mdatetime\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mdatetime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfromisoformat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'2020:08:01:00:00'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m: Invalid isoformat string: '2020:08:01:00:00'"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "datetime.fromisoformat('2020:08:01:00:00')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "from openpyxl import Workbook\n",
    "from datetime import datetime\n",
    "\n",
    "wb = Workbook()\n",
    "ws = wb.active  # 创建一个默认的sheet\n",
    "# ws1 = wb.create_sheet('name1', -1) # 在末尾创建一个名为name1的sheet\n",
    "\n",
    "ws['A1'] = 42\n",
    "ws.append([1, 2, 3])\n",
    "ws.cell(row=1, column=1, value=888)\n",
    "ws['A3'] = datetime.now()\n",
    "\n",
    "wb.save('sample.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "['END_SingleData',\n",
       " 'END_num',\n",
       " 'MID_SingleData',\n",
       " 'MID_num',\n",
       " 'TDZ_SingleData',\n",
       " 'TDZ_num',\n",
       " 'date_time',\n",
       " 'fromSource',\n",
       " 'runway_num',\n",
       " 'to_excel']"
      ]
     },
     "metadata": {},
     "execution_count": 12
    }
   ],
   "source": [
    "from airport_data import AutomaticObservationData\n",
    "''.startswith\n",
    "[i for i in dir(AutomaticObservationData()) if not i.startswith('__') and not i.endswith('__')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "output_type": "error",
     "ename": "TypeError",
     "evalue": "an integer is required (got type str)",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-12-c32570037fb5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mdatetime\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mdate\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mdate\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfromordinal\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'20200801'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: an integer is required (got type str)"
     ]
    }
   ],
   "source": [
    "from datetime import date\n",
    "\n",
    "date.fromordinal('20200801')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}